package com.cn.dao.impl;

import com.cn.dao.RoleDao;
import com.cn.domain.Role;
import com.cn.utils.MysqlBaseImpl;
import org.springframework.stereotype.Repository;

/**
 * Created by chenyuncong on 2019/9/16.
 */

@Repository
public class RoleDaoImpl extends MysqlBaseImpl<Role> implements RoleDao {
    public Role getRole(Integer userId) throws Exception {
        return this.get("select r.* from sys_user_role ur left join sys_role r on ur.role_id=r.id where ur.user_id=?",Role.class,userId);
    }
}

